4b3f54
@@ -179,7 +179,9 @@
public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx ctx,
       RowResolver inputRR = cppCtx.getOpToParseCtxMap().get(scanOp).getRR();
       for (int i = 0; i < cols.size(); i++) {
         int position = inputRR.getPosition(cols.get(i));
-        needed_columns.add(position);
+        if (position >=0) {
+          needed_columns.add(position);          
+        }
       }
       scanOp.setNeededColumnIDs(needed_columns);
       return null;
